<?php
$this->pageTitle=Yii::app()->name . ' - '.UserModule::t("Login");
$this->breadcrumbs=array(
	UserModule::t("Login"),
);
?>
<div id="login" class="login">
    <h1 style="text-align:left;padding:10px 0 20px 15px;"><?php echo UserModule::t("四川省计算机学会"); ?></h1>

    <?php if(Yii::app()->user->hasFlash('loginMessage')): ?>

    <div class="success">
        <?php echo Yii::app()->user->getFlash('loginMessage'); ?>
    </div>

    <?php endif; ?>

    <?php if(trim(CHtml::errorSummary($model))!=null): ?>
    <div class="error">
        <?php echo CHtml::errorSummary($model); ?>
    </div>
    <?php endif; ?>

    <div class="form">
    <?php echo CHtml::beginForm(); ?>

        <div class="row">
            <?php echo CHtml::activeLabelEx($model,'用户名'); ?>
            <?php echo CHtml::activeTextField($model,'username') ?>
        </div>

        <div class="row">
            <?php echo CHtml::activeLabelEx($model,'密码'); ?>
            <?php echo CHtml::activePasswordField($model,'password') ?>
        </div>

        <div class="row rememberMe forgetmenot">
            <?php echo CHtml::activeCheckBox($model,'rememberMe'); ?>
            <?php echo CHtml::activeLabelEx($model,'记住我的登录信息'); ?>
        </div>

        <div class="row submit">
            <?php echo CHtml::submitButton(UserModule::t("登录"),array('class'=>'button-primary')); ?>
        </div>

    <?php echo CHtml::endForm(); ?>
    </div><!-- form -->

    <div id="nav" class="row">
        <p class="hint">
            <?php echo CHtml::link(UserModule::t("Register"),Yii::app()->getModule('user')->registrationUrl); ?> | <?php echo CHtml::link(UserModule::t("Lost Password?"),Yii::app()->getModule('user')->recoveryUrl); ?>
        </p>
    </div>

    <p id="backtoblog">
        <a title="不知道自己在哪？" href="/">← 返回首页</a>
    </p>
</div>

<?php
$form = new CForm(array(
    'elements'=>array(
        'username'=>array(
            'type'=>'text',
            'maxlength'=>32,
        ),
        'password'=>array(
            'type'=>'password',
            'maxlength'=>32,
        ),
        'rememberMe'=>array(
            'type'=>'checkbox',
        )
    ),

    'buttons'=>array(
        'login'=>array(
            'type'=>'submit',
            'label'=>'Login',
        ),
    ),
), $model);
?>
